﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Class7
{
    public class Person
    {
        public Person(string name) { 
            this.Name = name;
            this.PayRecords=new string[30];
        }
        //姓名
        public string Name { get; set; }
        //花钱记录
        public string[] PayRecords { get; set; }
        private int payCount = 0;
        private int payTotalMoney = 0;
        public void Pay(int money)
        {
            Home.PayMoney(money);
            payTotalMoney += money;
            string record =this.Name+ "pay "+money+"yuan";
            this.PayRecords[payCount]=record;
            payCount++;
        }
        public void ShowPayRecords()
        {
            for (int i = 0; i < payCount; i++)
            {
                Console.WriteLine(this.PayRecords[i]);
            }
            Console.WriteLine("pay total money:"+payTotalMoney+" yuan");
        }
    }
}
